<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>暴风产品详情页</title>
		<link rel="stylesheet" type="text/css" href="css/login.css" />
		<link rel="stylesheet" type="text/css" href="css/header.css" />
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
		<script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
		<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
		<link rel="stylesheet" type="text/css" href="css/DetailPages.css" />
		<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css" />
		<script src="js/PCASClass.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<link rel="shortcut icon" type="image/x-icon" href="img/3.ico" media="screen" />
		
	</head>

	<body >
		<!-- 内容详情 -->
		<div style="overflow: hidden;"> <div class="Detail-mainbody row">
			<div class="Detail-wrapper">
				<!-- 面包屑 -->
				<div class="Detail-crumbs row">
					<ul class="Detail-index">
						<li>
							<a href="index.html" target="_blank">暴风商城</a>
						</li>

					</ul>
				</div>
				<!-- 产品介绍 -->
				<div class="Detail-box row">
					<!-- 产品相册 -->
					<div class="Detail-box-album row">
					</div>
					<!-- 产品详细 -->
					<div class="Detail-box-info">
						<div class="Detail"></div>
						<!-- 配送 -->
						<div class="Detail-box-buy-area row">
							<label>配送至</label>
							<select name="province"></select>
							<select name="city"></select>
							<select name="area"></select>
							<span>快递：免运费</span>
							<div class="Detail-box-q">
								<div class="Detail-box-text">
									<i></i>
									<div class="Detail-box-express-info-text">实际运费以结算页为准！</div>
								</div>
							</div>
							<div class="Detail-box-describe row">
								<span>商品由</span><span class="Detail-box-describe-red">暴风自营</span>
								<span>发货并提供售后服务</span>

							</div>
						</div>
						<!-- 数量 -->
						<div class="Detail-box-count row">
							<label>选择数量</label>
							<div class="Detail-box-count-form">
								<div class="Detail-box-count-cut" id="cut">-</div>
								<input type="text" name="" id="count"  />
								<div class="Detail-box-count-add" id="add">+</div>
							</div>
						</div>
						<!-- 购买 -->
						<div class="Detail-box-buttons row">
							<button type="button" class="join_button">加入购物车</button>
							<button type="button" class="buy-button">立即购买</button>
							<div class="Detail_box_like">
								<i></i>
								<div class="Detail-like">喜欢</div>
							</div>

						</div>
						<!-- 保障 -->
						<div class="Detail-box-service row">
							<span>服务承诺</span>
							<div class="Detail-box-service-content">
								<span>
									<i class="service-quality"></i>
									正品保障
								</span>
								<span>
									<i class="service-free"></i>
									包邮省心
								</span>
								<span>
									<i class="service-safeguard"></i>
									售后保障
								</span>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>

		<!-- 商品介绍 -->
		<div class="detail-text row">
			<div class="Detail-wrapper">
				<!-- 左边 -->
				<div class="detail-text-left">
					<div class="detail-text-store-link">
						<a href="href6.html" target="_blank">进入店铺</a>
					</div>
					<div class="detail-text-recommend">
						<h3>为您推荐</h3>
						<ul class="detail-text-recommend-list">
							<li>
								<a href="DetailPages.html?id=5" target="_blank">
									<img src="img/00499e8354a13194.jpeg">
									<div class="detail-text-recommend-info">
										<span>暴风魔镜Matrix 官方标准礼包</span>
										<p class="detail-text-recommend-price">¥2999
											<em>3298</em>
										</p>
									</div>
								</a>
							</li>
							<li>
								<a href="DetailPages.html?id=34" target="_blank">
									<img src="img/84a5aa5d110ee4de.jpeg">
									<div class="detail-text-recommend-info">
										<span>[秒杀]羞羞的铁拳 爆笑卡通人物系列抱枕</span>
										<p class="detail-text-recommend-price">¥29
											<em>99</em>
										</p>
									</div>
								</a>
							</li>
							<li style="border-bottom: none;">
								<a href="DetailPages.html?id=8" target="_blank">
									<img src="img/fecd9f1d67921262.png">
									<div class="detail-text-recommend-info">
										<span>暴风魔镜S1 VR新品</span>
										<p class="detail-text-recommend-price">¥199
											<em>299</em>
										</p>
									</div>
								</a>
							</li>
						</ul>
					</div>
				</div>

				<!-- 右边 -->
				<div class="detail-text-right">

				</div>
			</div>

		</div></div>
		
		<script src="js/jquery-3.3.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/login.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/alertLogin.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/header.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/addheader.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/DetailPages.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			/* 城市地区 */
			new PCAS("province", "city", "area", "江苏省", "苏州市", "沧浪区");
			$(function() {
				$.DetailPages.main()
				$("body").addHeader()
				var thisgoodsid = $.DetailPages.getQueryParams("id")
				
				$(".Detail-box-info").on("blur", "#count", function() { //手动输入物品总量
					var that = thisgoodsid
					var ttht=$(this)
					console.log(that)
					if(isNaN($(this).val())) { //非空验证
						layer.msg("请输入大于0的整数", {
							icon: 5
						})
						$(this).val(1)
						return false;
						
					}
					if(parseInt($(this).val()) < 1) { //小于零验证
						layer.msg("请输入大于0的整数", {
							icon: 5
						})
						
						$(this).val(1)
						
						return false;
					}
					if(parseInt($(this).val()) >= 1) {
						var number=parseInt($(this).val())
						console.log(number)
						/*console.log(1)
						for (var i=0;i<shopcarList.length;i++) {
							if(shopcarList[i].goosid === $(this).data("id")) {
							shopcarList[i]["count"]=parseInt($(this).val());
							break;
						}
						}
						$.cookie("shopcarlist", JSON.stringify(shopcarList))*/
						$.get("/checkStock", {
							id:that
						},function(data) {
							console.log(data.stock)
							
							if(parseInt(data.stock)<number){
								ttht.val(1)
								layer.msg("库存不足", {
							icon: 5
						})
							}
						
						console.log(data.stock)
						
						return false;
					})
				}
				})
			})
		</script>
		<!-- 弹出框 -->
		<div id="detail_content">
			<div class="detail-info">成功加入购物车！</div>
			<a href="shopcar.html" target="_blank">
				<button type="button" class="detail-info-yes">去购物车结算</button>
			</a>
			<button type="button" class="detail_info_no">继续购物</button>
		</div>

	</body>

</html>